package com.buydeem.builder;

/**
 * 构建指导类
 *
 * @author zengchao
 * @date 2022-04-25 15:33:33
 */
public class Director {

    private CarBuilder builder;

    public Director(CarBuilder builder) {
        this.builder = builder;
    }

    public Car build(){
        builder.buildEngine();
        builder.buildChassis();
        builder.buildGearbox();
        builder.buildTire();
        return builder.getResult();
    }

    public void setBuilder(CarBuilder builder) {
        this.builder = builder;
    }
}
